package contegor.scire.core;


/**
 * Defines the basic behavior for all elements in the system that require to be identified by a {@link Id}.
 *
 * @version $Revision: 1.9 $
 * @author  Héctor Cirbián Pousa ($Author: hector $)
 */
@Version("$Id: Identifiable.java,v 1.9 2010-02-01 10:55:39 hector Exp $")
public interface Identifiable {
  
  /** Returns the {@link IdFragment} that identifies <code>this</code> locally in its {@link Container}. */
  public IdFragment getLocalIdFragment();
  
  /** Returns the {@link Id} that identifies <code>this</code> in the whole system. */
  public Id getId();
  
  /**
   * Sets the {@link Container} to which <code>this</code> will belong. This method can be call only once per instance.
   * 
   * @param container {@link Container} to which <code>this</code> will belong.
   * @throws IllegalArgumentException if this method is called more than once in the same instance.
   */
  public void setContainer(Container container) throws IllegalArgumentException;

}
